﻿// TestClient.CustomFileDetail.xaml.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.html)
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2010
// ----------------------------------------------------------------------------
// File:       CustomFileDetail.xaml.cs
// Author:     HSS\gbanta
// Created:    07/16/2011
// Modified:   07/16/2011
// ----------------------------------------------------------------------------
using System.Windows;
using System.Windows.Controls;
using HSS.Interlink;

namespace TestClient
{
	public partial class CustomFileDetail : ChildWindow
	{
		string fileName = string.Empty;

		public CustomFileDetail(UploadFileViewModel viewModel)
		{
			this.fileName = viewModel.FileName;
			this.DataContext = viewModel;
			InitializeComponent();
			this.Title = "Demo [" + this.fileName + "]";
		}

		private void OKButton_Click(object sender, RoutedEventArgs e)
		{
			this.DialogResult = true;
			MainPage.Metadata[this.fileName] = new CustomMetadata()
			{
				Tag = this.txtTag.Text,
				Comment = this.txtComment.Text
			};
		}

		private void btnCancel_Click(object sender, RoutedEventArgs e)
		{
			this.DialogResult = false;
		}
	}
}